Optimal. Leaf size=205 \[ -\frac {a^3 \cot ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}-\frac {a^2 b \csc ^3(c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}+\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {a b^2 \cot ^3(c+d x)}{d}-\frac {6 a b^2 \cot (c+d x)}{d}-\frac {5 b^3 \csc ^3(c+d x)}{6 d}-\frac {5 b^3 \csc (c+d x)}{2 d}+\frac {5 b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b^3 \csc ^3(c+d x) \sec ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 205, normalized size of antiderivative = 1.00, number of steps used = 17, number of rules used = 9, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3872, 2912, 3767, 2621, 302, 207, 2620, 270, 288} \[ -\frac {a^2 b \csc ^3(c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}+\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a^3 \cot ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {a b^2 \cot ^3(c+d x)}{d}-\frac {6 a b^2 \cot (c+d x)}{d}-\frac {5 b^3 \csc ^3(c+d x)}{6 d}-\frac {5 b^3 \csc (c+d x)}{2 d}+\frac {5 b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b^3 \csc ^3(c+d x) \sec ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 207
Rule 270
Rule 288
Rule 302
Rule 2620
Rule 2621
Rule 2912
Rule 3767
Rule 3872
Rubi steps
\begin {align*} \int \csc ^4(c+d x) (a+b \sec (c+d x))^3 \, dx &=-\int (-b-a \cos (c+d x))^3 \csc ^4(c+d x) \sec ^3(c+d x) \, dx\\ &=\int \left (a^3 \csc ^4(c+d x)+3 a^2 b \csc ^4(c+d x) \sec (c+d x)+3 a b^2 \csc ^4(c+d x) \sec ^2(c+d x)+b^3 \csc ^4(c+d x) \sec ^3(c+d x)\right ) \, dx\\ &=a^3 \int \csc ^4(c+d x) \, dx+\left (3 a^2 b\right ) \int \csc ^4(c+d x) \sec (c+d x) \, dx+\left (3 a b^2\right ) \int \csc ^4(c+d x) \sec ^2(c+d x) \, dx+b^3 \int \csc ^4(c+d x) \sec ^3(c+d x) \, dx\\ &=-\frac {a^3 \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{d}-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \frac {x^4}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \operatorname {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^4} \, dx,x,\tan (c+d x)\right )}{d}-\frac {b^3 \operatorname {Subst}\left (\int \frac {x^6}{\left (-1+x^2\right )^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a^3 \cot (c+d x)}{d}-\frac {a^3 \cot ^3(c+d x)}{3 d}+\frac {b^3 \csc ^3(c+d x) \sec ^2(c+d x)}{2 d}-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \left (1+x^2+\frac {1}{-1+x^2}\right ) \, dx,x,\csc (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \operatorname {Subst}\left (\int \left (1+\frac {1}{x^4}+\frac {2}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}-\frac {\left (5 b^3\right ) \operatorname {Subst}\left (\int \frac {x^4}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{2 d}\\ &=-\frac {a^3 \cot (c+d x)}{d}-\frac {6 a b^2 \cot (c+d x)}{d}-\frac {a^3 \cot ^3(c+d x)}{3 d}-\frac {a b^2 \cot ^3(c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {a^2 b \csc ^3(c+d x)}{d}+\frac {b^3 \csc ^3(c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {\left (3 a^2 b\right ) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}-\frac {\left (5 b^3\right ) \operatorname {Subst}\left (\int \left (1+x^2+\frac {1}{-1+x^2}\right ) \, dx,x,\csc (c+d x)\right )}{2 d}\\ &=\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}-\frac {6 a b^2 \cot (c+d x)}{d}-\frac {a^3 \cot ^3(c+d x)}{3 d}-\frac {a b^2 \cot ^3(c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {5 b^3 \csc (c+d x)}{2 d}-\frac {a^2 b \csc ^3(c+d x)}{d}-\frac {5 b^3 \csc ^3(c+d x)}{6 d}+\frac {b^3 \csc ^3(c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d}-\frac {\left (5 b^3\right ) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{2 d}\\ &=\frac {3 a^2 b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {5 b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {a^3 \cot (c+d x)}{d}-\frac {6 a b^2 \cot (c+d x)}{d}-\frac {a^3 \cot ^3(c+d x)}{3 d}-\frac {a b^2 \cot ^3(c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {5 b^3 \csc (c+d x)}{2 d}-\frac {a^2 b \csc ^3(c+d x)}{d}-\frac {5 b^3 \csc ^3(c+d x)}{6 d}+\frac {b^3 \csc ^3(c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.97, size = 610, normalized size = 2.98 \[ -\frac {\csc ^7\left (\frac {1}{2} (c+d x)\right ) \sec ^3\left (\frac {1}{2} (c+d x)\right ) \left (4 a^3 \cos (3 (c+d x))-4 a^3 \cos (5 (c+d x))+8 \left (6 a^2 b+5 b^3\right ) \cos (2 (c+d x))+32 a \left (a^2+3 b^2\right ) \cos (c+d x)-36 a^2 b \cos (4 (c+d x))+36 a^2 b \sin (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-36 a^2 b \sin (c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+18 a^2 b \sin (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-18 a^2 b \sin (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )-18 a^2 b \sin (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+18 a^2 b \sin (5 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+84 a^2 b+48 a b^2 \cos (3 (c+d x))-48 a b^2 \cos (5 (c+d x))-30 b^3 \cos (4 (c+d x))+30 b^3 \sin (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-30 b^3 \sin (c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+15 b^3 \sin (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-15 b^3 \sin (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )-15 b^3 \sin (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+15 b^3 \sin (5 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+22 b^3\right )}{768 d \left (\cot ^2\left (\frac {1}{2} (c+d x)\right )-1\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.21, size = 260, normalized size = 1.27 \[ -\frac {8 \, {\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} + 6 \, {\left (6 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{4} + 36 \, a b^{2} \cos \left (d x + c\right ) - 12 \, {\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 6 \, b^{3} - 8 \, {\left (6 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left ({\left (6 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{4} - {\left (6 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 3 \, {\left ({\left (6 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{4} - {\left (6 \, a^{2} b + 5 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{4} - d \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.52, size = 361, normalized size = 1.76 \[ \frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 45 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 63 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 27 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, {\left (6 \, a^{2} b + 5 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 12 \, {\left (6 \, a^{2} b + 5 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {24 \, {\left (6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}} - \frac {9 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 45 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 63 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 27 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.92, size = 246, normalized size = 1.20 \[ -\frac {2 a^{3} \cot \left (d x +c \right )}{3 d}-\frac {a^{3} \cot \left (d x +c \right ) \left (\csc ^{2}\left (d x +c \right )\right )}{3 d}-\frac {a^{2} b}{d \sin \left (d x +c \right )^{3}}-\frac {3 a^{2} b}{d \sin \left (d x +c \right )}+\frac {3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {b^{2} a}{d \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {4 b^{2} a}{d \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 a \,b^{2} \cot \left (d x +c \right )}{d}-\frac {b^{3}}{3 d \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )^{2}}+\frac {5 b^{3}}{6 d \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {5 b^{3}}{2 d \sin \left (d x +c \right )}+\frac {5 b^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.56, size = 190, normalized size = 0.93 \[ -\frac {b^{3} {\left (\frac {2 \, {\left (15 \, \sin \left (d x + c\right )^{4} - 10 \, \sin \left (d x + c\right )^{2} - 2\right )}}{\sin \left (d x + c\right )^{5} - \sin \left (d x + c\right )^{3}} - 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} + 1\right )}}{\sin \left (d x + c\right )^{3}} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a b^{2} {\left (\frac {6 \, \tan \left (d x + c\right )^{2} + 1}{\tan \left (d x + c\right )^{3}} - 3 \, \tan \left (d x + c\right )\right )} + \frac {4 \, {\left (3 \, \tan \left (d x + c\right )^{2} + 1\right )} a^{3}}{\tan \left (d x + c\right )^{3}}}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.17, size = 260, normalized size = 1.27 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\left (a-b\right )}^3}{24\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,b\,{\left (a-b\right )}^2}{4}-\frac {3\,{\left (a-b\right )}^3}{8}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {7\,a^3}{3}+13\,a^2\,b+19\,a\,b^2+\frac {25\,b^3}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {17\,a^3}{3}+29\,a^2\,b+89\,a\,b^2+\frac {77\,b^3}{3}\right )+a\,b^2+a^2\,b+\frac {a^3}{3}+\frac {b^3}{3}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (3\,a^3+15\,a^2\,b+69\,a\,b^2+b^3\right )}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2\,b\,6{}\mathrm {i}+b^3\,5{}\mathrm {i}\right )\,1{}\mathrm {i}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________